/*
 * Copyright 2011 Katsunori Koyanagi
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package css
{
	import flash.display.GradientType;
	import flash.display.Graphics;
	import flash.geom.Matrix;
	import mx.skins.RectangularBorder;

	public class HeaderSkin extends RectangularBorder
	{

		public function HeaderSkin()
		{
		}

		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);

			var g:Graphics = graphics;
			var m:Matrix = new Matrix();
			m.createGradientBox(unscaledWidth, unscaledHeight, Math.PI / 2);
			g.clear();
			g.beginGradientFill(GradientType.LINEAR, [0x2a2a2a, 0x191919], [1, 1], [0, 255], m);
			g.drawRoundRectComplex(0, 0, unscaledWidth, unscaledHeight, 10, 10, 0, 0);
			g.endFill();
		}
	}
}
